package com.sxt;

import java.util.ArrayList;
import java.util.List;

import com.sxt.pro.pojo.Bank;

/**  

* @Description:  机构树 树  获取节点

* @author xinxiaokang  

* @date 2020年12月19日 上午12:25:57

*/
public class Aa {
	
	private List<Integer> childrenWithIds = new ArrayList<>();
	public Object getOrgFatherAndSonIds;

	protected List<Integer> getOrgFatherAndSonIds(List<Bank> listAll, Integer id){
			this.childrenWithIds.clear();
			List<Integer> list = recursionGetIds(listAll, id);
			list.add(id);
			return list;
		}

	private List<Integer> recursionGetIds(List<Bank> list, Integer id){
			for (Bank p:list){
				if (p.getParentid().equals(id)){
					recursionGetIds(list, p.getId());
					childrenWithIds.add(p.getId());
				}
			}
			return childrenWithIds;
		}
	
	
}
